import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/majors',
    method: 'get',
    params
  })
}
export function getAllMajors(params) {
  return request({
    url: '/all-majors',
    method: 'get',
    params
  })
}
export function create(params) {
  return request({
    url: '/majors',
    method: 'post',
    data: params
  })
}

export function updateStatus(id, status) {
  return request({
    url: '/majors/' + id + '/status/' + status,
    method: 'put'
  })
}
export function update(college, major, catalog, params) {
  return request({
    url: '/majors/' + college + '/college_name/' + catalog + '/catalog_name/' + major + '/major_name',
    method: 'put',
    data: params
  })
}

export function find(id) {
  return request({
    url: '/majors/' + id + '/name',
    method: 'get'
  })
}

export const deleteMajor = (college_name, major_name, catalog_name) => {
  return request({
    url: '/majors/' + college_name + '/college_name/' + catalog_name + '/catalog_name' + major_name + '/major_name',
    method: 'delete'
  })
}
